#include <iostream>
#define ll long long
using namespace std;

int main()
{
    int n;
    cin >> n;
    ll *row1 = new ll[n]; ll* row2 = new ll[n];
    for (int i=0; i<n; ++i) cin >> row1[i];
    for (int i=0; i<n; ++i) cin >> row2[i];
    ll* dp1 = new ll[n]; ll *dp2 = new ll[n];//ll *dp3 = new ll[n];

    *dp1 = row1[0]; *dp2 = row2[0]; //*dp3 = 0;
    for (int i=1; i<n; ++i)
    {
        dp1[i] = max(dp2[i-1] + row1[i], dp1[i-1]);
        dp2[i] = max(dp1[i-1] + row2[i], dp2[i-1]);
        //dp3[i] = max(dp1[i-1], dp2[i-1]);
    }
    /*ll a = dp1[n-1], b = dp2[n-1], c = dp3[n-1];
    ll Max = a>b ? (a>c ? a:c) : (b>c ? b:c);
    cout << Max;*/
    cout << max(dp1[n-1], dp2[n-1]);
    delete [] row1; delete [] row2; delete [] dp1; delete [] dp2;//delete [] dp3;
    return 0;
}
